import React from 'react'
// ===================================================================== Temp
import SubmitForm from '#cpt/temp/SubmitForm'
import Controls from '#cpt/temp/Controls'
// ===================================================================== global declare
const { $fn, $Lazy, $http } = window
// ===================================================================== Lazy
const Page 					= $Lazy.load(()=>import('#tp/page/page-container-scroll'))
const width = 300
// ===================================================================== component
class Index extends React.Component{
	state = {
		// 搜索表单列表
		formData : [
			{ label: '编号',		name: 'spec_num', 		width, readOnly:true, p:'--', title:'报告单基础信息',},
			{ label: '标本条码',		name: 'spec_code', 		width, readOnly:true, p:'--' },
			{ label: '报告单路径',	name: 'report_path',	width, readOnly:true, p:'--' },
			{ label: '所属医院',		name: 'hosp_name', 		width, readOnly:true, p:'--' },
			{ label: '所属派送人',	name: 'salesman_name', 	width, readOnly:true, p:'--' },
			{ label: '生成时间',		name: 'created_at', 	width, readOnly:true, p:'--' },
			{ label: '派送完成时间',	name: 'update_at', 		width, readOnly:true, p:'--' },
			{ label: '报告单状态',	name: 'status_name', 	width, readOnly:true, p:'--' },
			{ p: '报告单基础信息', 	name: 'json_data',	 	full:true,	type:'textarea', style:{padding:'0 10px'},  rows:15, hideLabel:true,	title:'报告单基础信息', width },
		],
	}
	
	componentDidMount(){
		$http.submit(null,'kd-report-spec/info',{ param:{uuid:$fn.query('uuid')} }).then(data=>{
			this.formRef.setValue(data)
		})
	}
	
	// 操作按钮
	controls = () => [ Controls.back.call(this) ]
	render(){
		return (
			<>
				<Page title='查看报告单' controls={this.controls()} className='pl10 pr10 pb10'>
					{ SubmitForm.call(this,{ labelWidth:'s8', mb:0})  }
				</Page>
			</>
		)
	}
}

export default Index